Skip to content
This repository has been archived by the owner on Jul 20, 2018. It is now read-only.

Adding three checks for non-escaped localization function calls. #315

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gudmdharalds
Copy link
Contributor

The first checks if output of the __( ), _x( ), _n( ), _nx( ) functions
is being printed directly, via echo( ), print( ) or vprintf( )
-- care is taken to ensure that both echo with and without
brackets is considered, and same with print. These are blockers.

The second checks if __( ), _x( ), _n( ), _nx( ) functions are
being called (without printing). These are warnings.

The third checks if _e( ) or _ex( ) are being called.
These are blockers.

These checks are all against localization functions which do not
HTML-escape. Not escaping can be dangerous since HTML code could
be injected via malicous translation strings. Blocking was considered
prudent with direct printing, because there is no escaping involved,
whereas warnings are issued when strings are possibly escaped later
on in processing.

This will resolve issue #287.

The first checks if output of the __( ), _x( ), _n( ), _nx( ) functions
is being printed directly, via echo( ), print( ) or vprintf( )
-- care is taken to ensure that both echo with and without
brackets is considered, and same with print. These are blockers.

The second checks if __( ), _x( ), _n( ), _nx( ) functions are
being called (without printing). These are warnings.

The third checks if _e( ) or _ex( ) are being called.
These are blockers.

These checks are all against localization functions which do not
HTML-escape. Not escaping can be dangerous since HTML code could
be injected via malicous translation strings. Blocking was considered
prudent with direct printing, because there is no escaping involved,
whereas warnings are issued when strings are possibly escaped later
on in processing.
@david-binda david-binda self-assigned this Mar 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants